//
//  LWHImageView.m
//  ProjectA
//
//  Created by dllo on 16/3/2.
//  Copyright © 2016年 刘旺辉. All rights reserved.
//

#import "LWHImageView.h"
#import "AppMacro.h"
@interface LWHImageView ()

@end

@implementation LWHImageView
- (void)dealloc {
    [_imageView release];
    [_buttonForIcon release];
    [_labelForName release];
    [super dealloc];
}
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        
        self.imageView = [[UIImageView alloc] init];
        [self addSubview:self.imageView];
        [_imageView release];
        self.imageView.userInteractionEnabled = YES;
        
//        self.buttonForIcon = [UIButton buttonWithType:UIButtonTypeCustom];
//        [self.imageView addSubview:self.buttonForIcon];
//        [_buttonForIcon release];
        
        self.labelForName = [[UILabel alloc] init];
        [self addSubview:self.labelForName];
        [_labelForName release];
        
        
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
//    self.imageView.frame = CGRectMake(self.bounds.size.width / 2.f - (self.imageView.frame.size.width / 2.f), self.bounds.size.height / 2.f - (self.imageView.frame.size.height / 2.f), 100, 100);
//    self.imageView.layer.cornerRadius = self.imageView.frame.size.width / 2.f;
//    self.imageView.layer.masksToBounds = YES;
//    self.imageView.layer.borderWidth = 2;
//    self.imageView.layer.borderColor = [[UIColor whiteColor] CGColor];
//    
//    
////    self.buttonForIcon.frame = CGRectMake(0, 0, self.imageView.frame.size.width, self.imageView.frame.size.height);
////    self.buttonForIcon.backgroundColor = [UIColor clearColor];
//    
//    self.labelForName.frame = CGRectMake(self.bounds.size.width / 2.f - (self.imageView.frame.size.width / 2.f) - 20, self.imageView.frame.origin.y + self.imageView.frame.size.height + 10, self.imageView.frame.size.width + 40, 30);
//    
//    self.labelForName.textAlignment = 1;
//    self.labelForName.userInteractionEnabled = NO;
    
}

@end
